package com.pingan.advice;

import com.pingan.util.RespResult;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(value = {RuntimeException.class})
    public RespResult doHandlerRuntimeException(RuntimeException e){
        log.error("exception is : {}",e.getMessage());
        return RespResult.fail(e.getMessage());
    }
}
